package service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import entity.LayRequest;
import entity.Sale_opportunity;
import mapper.Sale_opportunityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Administrator
 * @create 2020.06.22 下午 8:22
 */
@Service
public class Sale_opportunityServiceImpl implements Sale_opportunityService {
    @Autowired
    private Sale_opportunityMapper sale_op;

    @Override
    public PageInfo<Sale_opportunity> selectByMap(LayRequest layRequest) {
        PageHelper.startPage(layRequest.getPage(),layRequest.getLimit());
        List<Sale_opportunity> roles=sale_op.selectByMap(layRequest.getParams());
        return new PageInfo<>(roles);
    }

    @Override
    public boolean insert(Sale_opportunity sale_opportunity) {
        return sale_op.insert(sale_opportunity)>0?true : false;
    }

    @Override
    public boolean delete(Integer id) {
        return sale_op.delete(id)>0?true : false;
    }

    @Override
    public boolean updatestatus(Integer id) {
        return sale_op.updatestatus(id)>0?true : false;
    }
}
